#起名大师
from langchain_openai import ChatOpenAI
from langchain.prompts import PromptTemplate
import os

api_key = os.getenv("OPENAI_API_KEY")
api_base = os.getenv("OPENAI_API_BASE")

llm = ChatOpenAI(
    model="gpt-3.5-turbo",
    temperature=0,
    max_retries=2,
    api_key=api_key,
    base_url=api_base,
)

prompt = PromptTemplate.from_template("你是一个起名大师,请模仿示例起3个{county}名字,比如男孩经常被叫做{boy},女孩经常被叫做{girl}")
message = prompt.format(county="中国特色的",boy="狗蛋",girl="翠花")

print(message)
res = llm.invoke(message)
print(res.content)